﻿@using BonjourQuotation.UI.Models.CustomerModel
@model ManageCustomerPaymentGroupsGridViewModel


@using (@Html.BeginForm("SaveCustomerPaymentGroupsData", "Customer", FormMethod.Post, new { id = "LoadCustomerPaymentGroupsForm", style = "height: 0px !important;" }))
{
    <div id="ErrorMessagesDivPopUp">
        <label for="Validation" id="errorMessageClient" class="errorMessage"></label>
        @if (Model.Message != null)
        {
            @Html.LabelForModel(Model.Message, new { @class = "errorMessage", id = "errorMessageServer" })
        }
    </div>
    
     @Html.HiddenFor(model => model.CustomerID, new { @class = "CustomerPaymentGroupsCustomerID" })
     @Html.HiddenFor(model => Model.LineNo, new { @class = "CustomerPaymentGroupsLineNo" }) 
    
    <div style="width: 621px; min-height: 60px; max-height: 120px; margin: auto; padding-bottom: 30px; float:left">
        <table class="table table-bordered table-hover table-condensed" style="margin-bottom: -1px !important; width: 600px; background-color: white;">
            <thead>
                <tr>
                    <th width="60%;" class="GridHeaders font12">Group</th>
                    <th width="20%;" class="GridHeaders font12">Debit</th>
                    <th width="20%;" class="GridHeaders font12">Credit</th>
                </tr>
            </thead>
        </table>
        <div style="height: 80px; overflow-y: auto;">
            <table class="table table-bordered table-hover table-condensed" style="width: 600px; table-layout: fixed; background-color: white;">
                <tbody>
                    @for (int ind = 0; ind < Model.Rows.Count; ind++)
                    {
                        @Html.HiddenFor(model => model.Rows[ind].OldSelectedGroupsID)
                        Model.GroupID = Model.Rows[ind].SelectedGroupsID;
                        <tr>
                            <td width="60%;">
                                @Html.DropDownListFor(model => Model.GroupID, new SelectList(Model.Groups, "Value", "Text"), new { @class = "table_inputs_350 table_inputs_WithoutBox PaymentGroupDrop CustomerPaymentGroupsElementChange FSizeForGroupTable GroupCode" })
                                @Html.DropDownListFor(model => Model.Rows[ind].SelectedGroupsID, new SelectList(Model.Groups, "Value", "Text"), new { @class = "RoomGridDropHide" })
                            </td>
                            <td width="20%;">
                                @Html.LabelForModel(Model.Rows[ind].Refunded, new { @class = "table_inputs_110 FSizeForGroupTable", @style = "text-align: left" })
                            </td>
                            <td width="20%;">
                                @Html.TextBoxFor(model => model.Rows[ind].Received, new { @class = "table_inputs_110 table_inputs_WithoutBox FSizeForGroupTable money CustomerPaymentGroupsElementChange" })
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
      <div style="float: left;width:320px;height:120px;padding-top:15px" id="PaymentSaveCloseAddNewPaymentGroupBtns">
          @if(Model.MenuManageCustomerEdit)
          { 
              @*<button class=" btn14 btn50" type="button" onclick="$('#cboxClose').click()">Cancel</button>*@
              <button class="btn14 btn50" style="float: right; margin-right: 15px; " type="button" id="CustomerPaymentGroupsSaveBtn">Save</button>
              <button class="btn14 btn130" style="float: right; margin-right: 15px; " type="button" onclick="AddNewPaymentGroupShow()">Add New Group</button>
          }
          else
          {
              @*<button class=" btn14 btn50" type="button" onclick="$('#cboxClose').click()">Cancel</button>*@
              <button class="btn14 btn50 disabled" style="float: right; margin-right: 15px; " type="button" disabled="disabled" id="CustomerPaymentGroupsSaveBtn">Save</button>
              <button class="btn14 btn130 disabled" style="float: right; margin-right: 15px; " type="button" disabled="disabled" onclick="AddNewPaymentGroupShow()">Add New Group</button>
          }
        </div>
   
}
@using (@Html.BeginForm("SaveCustomerPaymentGroupsData", "Customer", FormMethod.Post, new { id = "LoadCustomerAddPaymentGroupsForm", style = "height: 0px;margin-top: 130px;" }))
{
    <div style="height:55px">
        <div id="AddPaymentGroupDiv" style="display:none;height:55px ">
            <div id="ErrorMessagesDivPopUp">
                <label for="Validation" id="errorMessageClient" class="errorMessage"></label>
                @if (Model.Message != null)
                {
                    @Html.LabelForModel(Model.Message, new { @class = "errorMessage", id = "errorMessageServer" })
                }
            </div>
            <div style="width: 850px; height: 30px;">
                <div style="width: 621px; float: left; height: 30px;">
                    <table class="table table-bordered table-hover table-condensed" style="width: 600px; table-layout: fixed; background-color: white;">
                        <tbody>
                            <tr>
                                <td width=60%>
                                    @Html.DropDownListFor(model => Model.AddGroupID, new SelectList(Model.Groups, "Value", "Text"), new { @class = "table_inputs_350 table_inputs_WithoutBox AddCustomerPaymentGroupsElementChange PaymentDrop FSizeForGroupTable CustomerPaymentAddGroupID" })
                                </td>
                                <td width=20%>
                                    @Html.LabelForModel(Model.Refunded, new { @class = "table_inputs_110 FSizeForGroupTable CustomerDepositeRefunded", @style = "text-align: left" })
                                </td>
                                <td width=20%>
                                    @Html.TextBoxFor(model => model.Received, new { @class = "table_inputs_110 table_inputs_WithoutBox CustomerDepositeReceived FSizeForGroupTable QuotaOnlyDecimalDigits MoneyTxb AddCustomerPaymentGroupsElementChange" })
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div style="float:left;width:150px;height:30px;padding-top:2.5px">
                @if(Model.MenuManageCustomerEdit)
                {
                    <button class="btn14 btn50" type="button" style="float: right; margin-right: 15px; " id="AddCustomerPaymentGroupsBtn">Save</button>
                    <button class=" btn14 btn50" type="button" style="float: right; margin-right: 15px; " onclick="AddNewPaymentGroupsClose()">Cancel</button>
                }
                else
                {
                    <button class="btn14 btn50 disabled" type="button" disabled="disabled" style="float: right; margin-right: 15px; " id="AddCustomerPaymentGroupsBtn">Save</button>
                    <button class=" btn14 btn50 disabled" type="button" disabled="disabled" style="float: right; margin-right: 15px; " onclick="AddNewPaymentGroupsClose()">Cancel</button>
                }
                </div>
            </div>
        </div>
    </div>
    <div style="float: left; width: 600px !important; height: 75px; padding-top: 26px;">
        <div style="float:right;width:364px">
            <div class="col-lg-8" style="padding-left: 0px; padding-right: 0px;">
                <div class="input-group">
                    <span class="input-group-addon inpputgrtext table_inputs_SmallPadding2 inpputgrback">@Html.LabelFor(model => model.SumOfRefunded)</span>
                    @Html.LabelForModel(Model.SumOfRefunded, new { @class = "table_inputs_SmallPadding2 inpputgr form-control", @style="width:123px !important" })
                </div>
            </div>
            <div class="col-lg-4" style="padding-right: 0px; padding-left: 0px;">
                <div class="input-group">
                    @Html.LabelForModel(Model.SumOfReceived, new { @class = "table_inputs_SmallPadding2 inpputgr form-control", @style = "width:120px !important;margin-left: 1px;" })
                </div>
            </div>
        </div>
    </div>
}

